//
//  LSYFastLookImagesTableViewCell.m
//  Cartoon
//
//  Created by dllo on 15/7/17.
//  Copyright (c) 2015年 dllo. All rights reserved.
//
#import "BaseHeader.h"
#import "LSYFastLookImagesTableViewCell.h"
#import "ZYLImageSize.h"
#import "UIImageView+WebCache.h"

@interface LSYFastLookImagesTableViewCell ()

@end

@implementation LSYFastLookImagesTableViewCell
- (void)dealloc
{
    [_imagesUrl release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.cartoonImg = [[[UIImageView alloc] init] autorelease];
        [self.contentView addSubview:self.cartoonImg];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.cartoonImg.frame = CGRectMake(0, 0, SCREEN_WIDTH, ([[self class] imageHeight:self.imagesUrl].height * SCREEN_WIDTH) / [[self class] imageHeight:self.imagesUrl].width);
    NSLog(@"-------------------%f", self.cartoonImg.frame.size.height);
    [self.cartoonImg sd_setImageWithURL:[NSURL URLWithString:self.imagesUrl] placeholderImage:[UIImage imageNamed:@"Fastlook_placeholder"]];
}

+ (CGSize)imageHeight:(NSString *)imageURL
{
    CGSize size = [ZYLImageSize downloadImageSizeWithURL:imageURL];
    return size;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
